//
//  PlayerManager.h
//  ImGuider
//
//  Created by 王鹏宇 on 2017/4/13.
//  Copyright © 2017年 imguider. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <MediaPlayer/MPMediaItem.h>
#import <MediaPlayer/MPNowPlayingInfoCenter.h>
#import "IGAvPlayerManager.h"

@protocol PlayerManagerDelegate <NSObject>

@optional

- (void)updateProgressWith:(CGFloat)value;

@end
@interface PlayerManager : NSObject

@property (nonatomic, copy)NSString * currentURL;

@property (nonatomic, copy)NSString * currentTime;
@property (nonatomic, copy)NSString * durantion;

@property (nonatomic)NSTimeInterval totaltime;


@property (nonatomic)float progress;  //记录进度条位置
@property (nonatomic)BOOL isPlay;
@property (nonatomic, weak)id<PlayerManagerDelegate> delegate;
@property (nonatomic, strong)id currentPlayModel;
@property (nonatomic, strong)NSTimer *timer;

+ (instancetype)shareManeger;

//播放音频的方法
- (void)playMusic:(NSString *)url withIsPlay:(BOOL) isImmediately;

//播放答案语音
- (void)playAnswerVideoWith:(NSString *)url;
//调整播放进度
- (void)musicSeekToTime:(float)time;

//暂停播放
- (void)pause;

//播放
- (void)play;

//停止
- (void)stop;

//重置当前已经听完的某个讲解点
-(void)resetMusic;

@end
